<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddLimitToPointGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('point_goods', function (Blueprint $table) {
        	if (!Schema::hasColumn('point_goods', 'limit')) {
        	    $table->integer('limit')->default(1)->comment('限购数量');
	        }
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('point_goods', function (Blueprint $table) {
        
        });
    }
}
